<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        //超时定时器
        var t1=setTimeout(function () {
            console.log('1秒到了')
        },3000)
        //间隔定时器
        var t2=setInterval(function() {
            console.log('1秒到了')
        }, 1000);

        clearTimeout(t1)
        clearInterval(t2)
        //如何定时输入1-9
        var i=1
        var t3=setInterval(function() {
            if(i<=9){
                console.log(i)
                i++
            }
            
        }, 1000);

    </script>
</body>
</html>